package cn.control;

import java.io.IOException;
import java.sql.SQLException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.dao.hotel_guestDao;

public class Guest_update extends HttpServlet{
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String phone = req.getParameter("phone");
		String passwd =req.getParameter("newphone");
		hotel_guestDao guestdao = new hotel_guestDao();
		boolean aa = false;
		try {
			aa=guestdao.UemlHoel_Guest(phone,passwd);
			if(aa=true) {
				RequestDispatcher rd=req.getRequestDispatcher("jsp/guest/own.jsp");
				rd.forward(req, resp);	
			}
				
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
	}
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}
}
